<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>后台管理</title>
    <link rel="stylesheet" href="/static/plugins/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="/static/css/main.css"  media="all"  />

    <!--[if lt IE 9]>
    <script src="/static/html5shiv.min.js"></script>
    <script src="/static/respond.min.js"></script>
    <![endif]-->
    <script type="text/javascript" src="/static/plugins/layui/layui.js"></script>
</head>
<body>

<!--主体-->
<div style="margin-bottom:36px;">

    <div class="layui-tab-brief">
        <div class="layui-tab-content">
            <div class="layui-tab-item layui-show">
                <form class="layui-form form-container" id="layui-form"
                      >

                    <div class="layui-form-item">
                        <label class="layui-form-label">用户昵称:</label>
                        <div class="layui-input-inline">
                            <span class="layui-view" th:text="${user1.nickName}"></span>
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">用户姓名:</label>
                        <div class="layui-input-inline">
                            <span class="layui-view" th:text="${user1.realName}"></span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">用户微信id:</label>
                        <div class="layui-input-inline">
                            <span class="layui-view" th:text="${user1.openId}"></span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">性别:</label>
                        <div class="layui-input-inline">
                            <span class="layui-view" th:text="${user1.gender}"></span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">语言:</label>
                        <div class="layui-input-inline">
                            <span class="layui-view" th:text="${user1.language}"></span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">城市:</label>
                        <div class="layui-input-inline">
                            <span class="layui-view" th:text="${user1.city}"></span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">省份:</label>
                        <div class="layui-input-inline">
                            <span class="layui-view" th:text="${user1.province}"></span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">国家:</label>
                        <div class="layui-input-inline">
                            <span class="layui-view" th:text="${user1.country}"></span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">头像:</label>
                        <img id="uploaded-image"  width="300" th:src="@{${user1.avatarUrl}}"  >
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">手机号:</label>
                        <div class="layui-input-inline">
                            <span class="layui-view" th:text="${user1.phone}"></span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">状态:</label>
                        <div class="layui-input-inline">
                            <span class="layui-view"  th:if="${user1.status eq -1}" th:text="禁用"></span>
                            <span class="layui-view"  th:if="${user1.status eq 1}" th:text="登录未认证"></span>
                            <span class="layui-view"  th:if="${user1.status eq 3}" th:text="审核未通过"></span>
                            <span class="layui-view"  th:if="${user1.status eq 4}" th:text="正常"></span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">注册时间:</label>
                        <div class="layui-input-inline">
                            <span class="layui-view" th:text="${#dates.format(user1.regtime,'yyyy-MM-dd HH:mm')}"></span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                    <label class="layui-form-label">最后登录时间:</label>
                    <div class="layui-input-inline">
                        <span class="layui-view" th:text="${#dates.format(user1.lastLoginTime,'yyyy-MM-dd HH:mm')}"></span>
                    </div>
                </div>
                    <div class="layui-form-item">
                    <label class="layui-form-label">学校:</label>
                    <div class="layui-input-inline">
                        <span class="layui-view" th:text="${user1.school}"></span>
                    </div>
                </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">学院:</label>
                        <div class="layui-input-inline">
                            <span class="layui-view" th:text="${user1.college}"></span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">班级:</label>
                        <div class="layui-input-inline">
                            <span class="layui-view" th:text="${user1.className}"></span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">学号:</label>
                        <div class="layui-input-inline">
                            <span class="layui-view" th:text="${user1.stuNo}"></span>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">身份证正面:</label>
                        <img width="300" th:src="@{${user1.idCard1}}"  >
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">身份证反面:</label>
                        <img    width="300" th:src="@{${user1.idCard2}}"  >
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">学生证:</label>
                        <img  width="300" th:src="@{${user1.stuCard}}"  >
                    </div>
                    <div style="float: right">
                    <a class="agrees layui-btn layui-btn-normal layui-btn-mini" href="javascript:;"
                       data-id="" th:attr="data-id=${user1.id}"
                    >审核通过</a>
                    <a class="noagree layui-btn layui-btn-danger layui-btn-mini" href="javascript:;"
                       data-id="" th:attr="data-id=${user1.id},data-name=${user1.nickName}"
                    >审核不通过</a></div>
                </form>
            </div>
        </div>
    </div>


</div>
<script src="/static/js/common.js"></script>
<script>
    layui.use(['layer', 'form', 'element'], function () {
        var form = layui.form
            , jq = layui.jquery;

        jq('.agrees').click(function () {

            var id=jq(this).data('id');
            var t=jq(this);
            layer.confirm('确定要审核通过么？', {
                btn: ['确定','取消']
            }, function(){

                ajaxform({},"/api/updatesUserStatus?id="+id+"&status=4",jq,function (res) {
                    window.location.href="/index"
                } );
            }, function(){
            });


        })
        jq('.noagree').click(function () {
            var id=jq(this).data('id');
            var name=jq(this).data('name');
            var t=jq(this);
            var tip= '&nbsp;&nbsp;亲爱的用户'+name+',您好，你的个人信息审核不通过，原因是:<br/>'
            layer.open({
                type: 1,
                title: '不通过原因',
                skin: 'layui-layer-rim', //加上边框
                area: ['430px', '350px'], //宽高
                content:tip+'<textarea cols="50"  rows="15"  id="content" placeholder="请输入内容"  style="margin: 10px"></textarea>' +
                '<button class="layui-btn layui-btn-normal send" style="float: right" >发送</button> '
            });

            jq('.send').click(function () {
                var formdata =   JSON.stringify({
                    'content': tip+ jq('#content').val()
                })
                console.log(formdata)
                ajaxform(formdata,"/shenhenoagree/"+id,jq,function (res) {
                    location.href="/index"
                } );

            })

        })

    })
</script>
</body>
</html>